package com.chixing.day08_interface.word;


import java.util.ArrayList;
import java.util.List;

public class Test {

    public static final int MAX_NUM = 1000;

    public static void main(String[] args) throws CloneNotSupportedException{
        Product product = new Product(101,"书");
        Order order = new Order("个人",product,1520);
        List list = new ArrayList<Order>();
        while (order.getNum() > MAX_NUM) {
            Order temp = (Order) order.clone();
            temp.setNum(MAX_NUM);
            list.add(temp);
            order.setNum(order.getNum() - MAX_NUM);
        }
        list.add(order);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i).toString());
        }
        System.out.println(list.size());
    }

}
